# Contributor: Edd Salkield <edd@salkield.uk>
# Maintainer: Edd Salkield <edd@salkield.uk>
pkgname=h4h5tools
pkgver=2.2.5
pkgrel=2
pkgdesc="Conversion utilities between hdf4 and hdf5"
url="https://support.hdfgroup.org/products/hdf5_tools/h4toh5/"
arch="all !riscv64" # limited by hdf4
license="custom"
depends_dev="hdf4-dev hdf5-dev zlib-dev portablexdr-dev jpeg-dev"
makedepends="$depends_dev"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://support.hdfgroup.org/ftp/HDF5/releases/h4toh5/h4toh5-$pkgver/src/h4h5tools-$pkgver.tar.gz
	h4h5tools-format-security-fix.patch
	"
options="!check" # Upstream tests appear broken

build() {
	export LIBS="$LIBS -ldf -lmfhdf -lz -lportablexdr -ljpeg"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/"$pkgname"/COPYING
}

sha512sums="
1749c5d4383695296fcc79dc900c2d04be267f01cfb006be8fd0f4baf0e6d51a04d788c76881fedba3d06ad2bf440a0dbceeb98d8b02b5ceade520900a726d40  h4h5tools-2.2.5.tar.gz
4ca99d14733299892e4c6f8815b761078dad2bbccae34fcff6747ebb230580ecddcf93e5d342cd454d579e37073f1f3437e3ac5a769064119484e90db2b93b80  h4h5tools-format-security-fix.patch
"
